﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Menu.ascx.cs" Inherits="$rootnamespace$.Controls.Menu" %>

<%@ Register TagPrefix="x" Namespace="$rootnamespace$.Controls" Assembly="$rootnamespace$" %>
<%@ Register TagPrefix="ow" Namespace="OpenWaves.Web.Controls" Assembly="OpenWaves.Web" %>

<%@ Import Namespace="OpenWaves" %>
<%@ Import Namespace="OpenWaves.Navigation" %>

<x:NavigationView runat="server" Model="<%# CreateModel() %>">
    
    <Template>
        <ul class="menu">
            <ow:ChildNodesPlaceHolder runat="server" />
        </ul>
    </Template>
    
    <NodeTemplate>
        <li>
            <a href="<%# Container.Node.Url %>"><%# Html.Encode(Container.Node.Name) %></a>
        </li>
    </NodeTemplate>

	<ExpandedNodeTemplate>
		<li>
			<a href="<%# Container.Node.Url %>"><%# Html.Encode(Container.Node.Name) %></a>

			<ow:ChildNodesPlaceHolder runat="server">
				<ul>
					<ow:ItemsPlaceHolder runat="server" />
				</ul>
			</ow:ChildNodesPlaceHolder>
		</li>
	</ExpandedNodeTemplate>

	<CurrentNodeTemplate>
		<li>
			<span><%# Html.Encode(Container.Node.Name) %></span>

			<ow:ChildNodesPlaceHolder runat="server">
				<ul>
					<ow:ItemsPlaceHolder runat="server" />
				</ul>
			</ow:ChildNodesPlaceHolder>
		</li>
	</CurrentNodeTemplate>
</x:NavigationView>
